package com.tyc.mb.common.util;

import org.springframework.util.DigestUtils;

/**
 * 类描述
 *
 * @author tyc
 * @version 1.0
 * @date 2021-10-28 15:46:29
 */
public class Md5 {
    public static String encode(String password){
        return DigestUtils.md5DigestAsHex(password.getBytes());
    }

    public static boolean matches(String password, String encodePassword){
        return DigestUtils.md5DigestAsHex(password.getBytes()).equals(encodePassword);
    }
}
